Welcome to Css!

10.06 透明度设置

5)对比度设置:filter:opacity(百分比)

默认值是100%,表示完全不透明

0%时,表示完全透明;

老片谷歌和欧朋浏览器需要加前缀:

-webkit-filter:opacity(80%)

文件rerest.css对image进行了重置:

image{border:none;vertical-align:top}

html:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>css</title>

<link rel="stylesheet" href="rerest.css">

<style type="text/css">

div{

width:108px;height:100px;background:red;

}

.one{

filter:opacity(80%);

width:100%;

}

</style>

</head>

<body>

<div>

<img class="one" src="css7.03.01.png" alt="">

</div>

<br>

<img src="css7.03.01.png" alt="">

</body>

</html>

返回值: